//package com.lf.controller;
//
//import com.lf.entity.ResponseWrapper;
//import com.lf.entity.vo.front.UserVo;
//import com.lf.enums.ErrorCodeEnum;
//import com.lf.exception.ApiException;
//import com.lf.jwt.CurrentManager;
//import com.lf.service.IUserService;
//import com.lf.swagger.ApiJsonObject;
//import com.lf.swagger.ApiJsonProperty;
//import com.lf.util.Asserts;
//import com.alibaba.fastjson.JSONObject;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.*;
//
//import javax.servlet.http.HttpServletRequest;
//
///**
// * @program: 用户接口【前端】
// * @description: 用户
// * @author: gxl
// * @create:
// **/
//@Slf4j
//@Api(value = "user", tags = "用户")
//@RestController
//@RequestMapping("/user")
//public class UserController {
//
//    @Autowired
//    private IUserService userService;
//    //测试ok
//    @RequestMapping(value = "/getVerificationCodeOfRegister", method = RequestMethod.POST)
//    @ApiOperation(tags = "用户", httpMethod = "POST", value = "[前端]用户获取注册验证码", response = String.class)
//    public ResponseWrapper getVerificationCodeOfRegister(
//            @ApiJsonObject(name = "getVerificationCodeOfRegisterParams", value = {
//                    @ApiJsonProperty(key = "mobile", value = "手机号")
//            }) @RequestBody JSONObject jsonParam) {
//        try {
//            String mobile = jsonParam.getString("mobile");
//            Asserts.checkMobile(mobile,"手机号码");
//
//            userService.sendVerificationCodeForRegister(mobile);
//            return ResponseWrapper.succeed("发送成功");
//        }catch (ApiException e){
//            log.error(String.format("[前端]用户获取验证码失败，参数:%s, 错误信息:%s", jsonParam.toJSONString(), e.getMessage()));
//            return ResponseWrapper.failed(e.getCode(), e.getMessage());
//        }catch (Exception e){
//            log.error(String.format("[前端]用户获取验证码失败"), e);
//            return ResponseWrapper.failed(ErrorCodeEnum.FL500);
//        }
//    }
//    //测试ok
//    @RequestMapping(value = "/getVerificationCodeOfChangePassword", method = RequestMethod.POST)
//    @ApiOperation(tags = "用户", httpMethod = "POST", value = "[前端]用户获取 “修改登录密码” 验证码", response = String.class)
//    public ResponseWrapper getVerificationCodeOfChangePassword(
//            @ApiJsonObject(name = "getVerificationCodeOfChangePasswordParams", value = {
////                    @ApiJsonProperty(key = "mobile", value = "手机号"),
//                    @ApiJsonProperty(key = "account", value = "用户名")
//            }) @RequestBody JSONObject jsonParam) {
//        try {
////            String mobile = jsonParam.getString("mobile");
//            String account = jsonParam.getString("account");
////            Asserts.checkMobile(mobile,"手机号码");
//            Asserts.checkAccount(account,"用户名");
//
//            userService.sendVerificationCodeForChangePassword(account);
//            return ResponseWrapper.succeed("发送成功");
//        }catch (ApiException e){
//            log.error(String.format("[前端]用户获取验证码失败，参数:%s, 错误信息:%s", jsonParam.toJSONString(), e.getMessage()));
//            return ResponseWrapper.failed(e.getCode(), e.getMessage());
//        }catch (Exception e){
//            log.error(String.format("[前端]用户获取验证码失败"), e);
//            return ResponseWrapper.failed(ErrorCodeEnum.FL500);
//        }
//    }
//
//    //测试ok
//    @CurrentManager
//    @RequestMapping(value = "/getVerificationCodeOfChangeMobile", method = RequestMethod.POST)
//    @ApiOperation(tags = "用户", httpMethod = "POST", value = "[前端]用户获取 “修改手机号” 验证码", response = String.class)
//    public ResponseWrapper getVerificationCodeOfChangeMobile(
//            @ApiJsonObject(name = "getVerificationCodeOfChangeMobileParams", value = {
//                    @ApiJsonProperty(key = "mobile", value = "手机号")
//            }) @RequestBody JSONObject jsonParam) {
//        try {
//            String mobile = jsonParam.getString("mobile");
//            String account = jsonParam.getString("account");
//            Asserts.checkMobile(mobile,"手机号码");
//            Asserts.checkAccount(account,"用户名");
//
//            userService.sendVerificationCodeForChangeMobile(mobile, account);
//            return ResponseWrapper.succeed("发送成功");
//        }catch (ApiException e){
//            log.error(String.format("[前端]用户获取验证码失败，参数:%s, 错误信息:%s", jsonParam.toJSONString(), e.getMessage()));
//            return ResponseWrapper.failed(e.getCode(), e.getMessage());
//        }catch (Exception e){
//            log.error(String.format("[前端]用户获取验证码失败"), e);
//            return ResponseWrapper.failed(ErrorCodeEnum.FL500);
//        }
//    }
//
//    @CurrentManager
//    @RequestMapping(value = "/getVerificationCodeOfPayPwd", method = RequestMethod.POST)
//    @ApiOperation(tags = "用户", httpMethod = "POST", value = "[前端]用户获取 “忘记支付密码” 验证码", response = String.class)
//    public ResponseWrapper getVerificationCodeOfPayPwd(
//            @ApiJsonObject(name = "getVerificationCodeOfPayPwdParams", value = {
//                    @ApiJsonProperty(key = "mobile", value = "手机号")
//            }) @RequestBody JSONObject jsonParam) {
//        try {
//            String mobile = jsonParam.getString("mobile");
//            String account = jsonParam.getString("account");
//            Asserts.checkMobile(mobile,"手机号码");
//            Asserts.checkAccount(account,"用户名");
//
//            userService.sendVerificationCodeForPayPwd(mobile, account);
//            return ResponseWrapper.succeed("发送成功");
//        }catch (ApiException e){
//            log.error(String.format("[前端]用户获取 “忘记支付密码” 验证码失败，参数:%s, 错误信息:%s", jsonParam.toJSONString(), e.getMessage()));
//            return ResponseWrapper.failed(e.getCode(), e.getMessage());
//        }catch (Exception e){
//            log.error(String.format("[前端]用户获取 “忘记支付密码” 验证码失败"), e);
//            return ResponseWrapper.failed(ErrorCodeEnum.FL500);
//        }
//    }
//
//    //测试ok
//    @CurrentManager
//    @RequestMapping(value = "/checkVerificationCodeOfPayPwd", method = RequestMethod.POST)
//    @ApiOperation(tags = "用户", httpMethod = "POST", value = "[前端]校验 “忘记支付密码” 的验证码", response = String.class)
//    public ResponseWrapper checkVerificationCodeOfPayPwd(
//            @ApiJsonObject(name = "checkVerificationCodeOfPayPwdParams", value = {
//                    @ApiJsonProperty(key = "mobile", value = "手机号"),
//                    @ApiJsonProperty(key = "code", value = "验证码")
//            }) @RequestBody JSONObject jsonParam) {
//        try {
//            String mobile = jsonParam.getString("mobile");
//            String account = jsonParam.getString("account");
//            String code = jsonParam.getString("code");
//            Asserts.checkMobile(mobile,"手机号码");
//            Asserts.checkAccount(account,"用户名");
//            Asserts.checkVcode(code,"验证码");
//
//            userService.checkVerificationCodeOfPayPwd(mobile, account, code);
//            return ResponseWrapper.succeed();
//        }catch (ApiException e){
//            log.error(String.format("[前端]校验 “忘记支付密码” 的验证码失败，参数:%s, 错误信息:%s", jsonParam.toJSONString(), e.getMessage()));
//            return ResponseWrapper.failed(e.getCode(), e.getMessage());
//        }catch (Exception e){
//            log.error(String.format("[前端]校验 “忘记支付密码” 的验证码失败"), e);
//            return ResponseWrapper.failed(ErrorCodeEnum.FL500);
//        }
//    }
//
//    //测试ok
//    @RequestMapping(value = "/checkVerificationCodeOfChangePassword", method = RequestMethod.POST)
//    @ApiOperation(tags = "用户", httpMethod = "POST", value = "[前端]校验 “修改登录密码” 的验证码", response = String.class)
//    public ResponseWrapper checkVerificationCodeOfChangePassword(
//            @ApiJsonObject(name = "checkVerificationCodeOfChangePasswordParams", value = {
////                    @ApiJsonProperty(key = "mobile", value = "手机号"),
//                    @ApiJsonProperty(key = "account", value = "用户名"),
//                    @ApiJsonProperty(key = "code", value = "验证码")
//            }) @RequestBody JSONObject jsonParam) {
//        try {
////            String mobile = jsonParam.getString("mobile");
//            String account = jsonParam.getString("account");
//            String code = jsonParam.getString("code");
////            Asserts.checkMobile(mobile,"手机号码");
//            Asserts.checkAccount(account,"用户名");
//            Asserts.checkVcode(code,"验证码");
//
//
//            userService.checkVerificationCodeOfChangePassword(account, code);
//            return ResponseWrapper.succeed();
//        }catch (ApiException e){
//            log.error(String.format("[前端]校验 “修改登录密码” 的验证码失败，参数:%s, 错误信息:%s", jsonParam.toJSONString(), e.getMessage()));
//            return ResponseWrapper.failed(e.getCode(), e.getMessage());
//        }catch (Exception e){
//            log.error(String.format("[前端]校验 “修改登录密码” 的验证码失败"), e);
//            return ResponseWrapper.failed(ErrorCodeEnum.FL500);
//        }
//    }
//    //测试ok
//    @RequestMapping(value = "/userLogin", method = RequestMethod.POST)
//    @ApiOperation(tags = "用户", httpMethod = "POST", value = "[前端]用户登录", response = UserVo.class)
//    public ResponseWrapper userLogin(
//            @ApiJsonObject(name = "userLoginParams", value = {
//                    @ApiJsonProperty(key = "account", value = "用户名"),
//                    @ApiJsonProperty(key = "password", value = "密码")
//            }) @RequestBody JSONObject jsonParam, HttpServletRequest request) {
//        try {
//            String password = jsonParam.getString("password");
//            String account = jsonParam.getString("account");
//            Asserts.checkPsw(password,"密码");
//            Asserts.checkAccount(account,"用户名");
//
////            String url = request.getScheme()+"://"+ request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/";
////            System.out.println("获取图片路径前缀 = " + url);
//
//            UserVo vo = userService.userLogin(account, password);
//            return ResponseWrapper.succeed(vo);
//        }catch (ApiException e){
//            log.error(String.format("[前端]用户登录失败，参数:%s, 错误信息:%s", jsonParam.toJSONString(), e.getMessage()));
//            return ResponseWrapper.failed(e.getCode(), e.getMessage());
//        }catch (Exception e){
//            log.error(String.format("[前端]用户登录失败"), e);
//            return ResponseWrapper.failed(ErrorCodeEnum.FL500);
//        }
//    }
//    //测试ok
//    @CurrentManager
//    @RequestMapping(value = "/loginOut", method = RequestMethod.POST)
//    @ApiOperation(tags = "用户", httpMethod = "POST", value = "[前端]用户登出", response = String.class)
//    public ResponseWrapper loginOut(
//            @ApiJsonObject(name = "loginOutParams", value = {}) @RequestBody JSONObject jsonParam) {
//
//        try {
//            String account = jsonParam.getString("account");
//            Asserts.checkAccount(account,"用户名");
//            userService.loginOut(account);
//            return ResponseWrapper.succeed();
//        }catch (ApiException e){
//            log.error(String.format("[前端]用户登出失败，参数:%s, 错误信息:%s", jsonParam.toJSONString(), e.getMessage()));
//            return ResponseWrapper.failed(e.getCode(), e.getMessage());
//        }catch (Exception e){
//            log.error(String.format("[前端]用户登出失败"), e);
//            return ResponseWrapper.failed(ErrorCodeEnum.FL500);
//        }
//    }
//    //测试ok
//    @RequestMapping(value = "/registry", method = RequestMethod.POST)
//    @ApiOperation(tags = "用户", httpMethod = "POST", value = "[前端]用户注册", response = String.class)
//    public ResponseWrapper registry(
//            @ApiJsonObject(name = "registryParams", value = {
//                    @ApiJsonProperty(key = "account", value = "用户名"),
//                    @ApiJsonProperty(key = "mobile", value = "手机号"),
//                    @ApiJsonProperty(key = "code", value = "验证码"),
//                    @ApiJsonProperty(key = "pass", value = "密码"),
////                    @ApiJsonProperty(key = "repass", value = "密码"),
//                    @ApiJsonProperty(key = "visitAccount", value = "推荐人用户名")
//            })@RequestBody JSONObject jsonParam) {
//        try {
//            String account = jsonParam.getString("account");
//            String mobile = jsonParam.getString("mobile");
//            String code = jsonParam.getString("code");
//            String pass = jsonParam.getString("pass");
////            String repass = jsonParam.getString("repass");
//            String visitAccount = jsonParam.getString("visitAccount");
//
//            Asserts.checkAccount(account,"用户名");
//            Asserts.checkMobile(mobile,"手机号");
//            Asserts.checkVcode(code,"验证码");
//            Asserts.checkPsw(pass,"密码");
////            Asserts.checkPsw(repass,"密码");
//            Asserts.checkVisitAccount(visitAccount,"推荐人用户名");
//
////            if (!pass.equals(repass)){
////                throw new ApiException(ErrorCodeEnum.TK1016.code(),ErrorCodeEnum.TK1016.msg());
////            }
//
//            userService.registry(account, mobile, code, pass, visitAccount);
//            return ResponseWrapper.succeed();
//        }catch (ApiException e){
//            log.error(String.format("[前端]用户注册失败，参数:%s, 错误信息:%s", jsonParam.toJSONString(), e.getMessage()));
//            return ResponseWrapper.failed(e.getCode(), e.getMessage());
//        }catch (Exception e){
//            log.error(String.format("[前端]用户注册失败"), e);
//            return ResponseWrapper.failed(ErrorCodeEnum.FL500);
//        }
//
//    }
//
//    @CurrentManager
//    @RequestMapping(value = "/myTeam", method = RequestMethod.POST)
//    @ApiOperation(tags = "用户", httpMethod = "POST", value = "[前端]获取我的团队（拼团消费）", response = FriendsVo.class)
//    public ResponseWrapper myTeam(
//            @ApiJsonObject(name = "myTeamParams", value = {}) @RequestBody JSONObject jsonParam) {
//        try {
//            String account = jsonParam.getString("account");
//            Asserts.checkAccount(account,"用户名");
//            FriendsVo vos = userService.myTeam(account);
//            return ResponseWrapper.succeed(vos);
//        }catch (ApiException e){
//            log.error(String.format("[前端]获取我的团队（拼团消费）失败，参数:%s, 错误信息:%s", jsonParam.toJSONString(), e.getMessage()));
//            return ResponseWrapper.failed(e.getCode(), e.getMessage());
//        }catch (Exception e){
//            log.error(String.format("[前端]获取我的团队（拼团消费）失败"), e);
//            return ResponseWrapper.failed(ErrorCodeEnum.FL500);
//        }
//
//    }
//
//
//    //测试ok
//    @RequestMapping(value = "/updatePassword", method = RequestMethod.POST)
//    @ApiOperation(tags = "用户", httpMethod = "POST", value = "[前端]未登录时: 用户修改登录密码", response = String.class)
//    public ResponseWrapper updatePassword(
//            @ApiJsonObject(name = "updatePasswordParams", value = {
//                    @ApiJsonProperty(key = "account", value = "用户名"),
//                    @ApiJsonProperty(key = "password", value = "密码"),
//                    @ApiJsonProperty(key = "repassword", value = "密码")
//            })@RequestBody JSONObject jsonParam) {
//        try {
//            String account = jsonParam.getString("account");
//            String password = jsonParam.getString("password");
//            String repassword = jsonParam.getString("repassword");
//
//            Asserts.checkAccount(account,"用户名");
//            Asserts.checkPsw(password,"密码");
//            Asserts.checkPsw(repassword,"密码");
//
//            userService.updatePassWord(account, password);
//            return ResponseWrapper.succeed("修改成功");
//        }catch (ApiException e){
//            log.error(String.format("[前端]用户修改登录密码失败，参数:%s, 错误信息:%s", jsonParam.toJSONString(), e.getMessage()));
//            return ResponseWrapper.failed(e.getCode(), e.getMessage());
//        }catch (Exception e){
//            log.error(String.format("[前端]用户修改登录密码失败"), e);
//            return ResponseWrapper.failed(ErrorCodeEnum.FL500);
//        }
//    }
//
//    //测试ok
//    @RequestMapping(value = "/forgotPassword", method = RequestMethod.POST)
//    @ApiOperation(tags = "用户", httpMethod = "POST", value = "[前端]未登录时: 用户修改登录密码", response = String.class)
//    public ResponseWrapper forgotPassword(
//            @ApiJsonObject(name = "forgotPasswordParams", value = {
//                    @ApiJsonProperty(key = "account", value = "用户名"),
//                    @ApiJsonProperty(key = "password", value = "密码"),
//                    @ApiJsonProperty(key = "repassword", value = "密码")
//            })@RequestBody JSONObject jsonParam) {
//        try {
//            String account = jsonParam.getString("account");
//            String password = jsonParam.getString("password");
//            String repassword = jsonParam.getString("repassword");
//
//            Asserts.checkAccount(account,"用户名");
//            Asserts.checkPsw(password,"密码");
//            Asserts.checkPsw(repassword,"密码");
//
//            userService.updatePassWord(account, password);
//            return ResponseWrapper.succeed("修改成功");
//        }catch (ApiException e){
//            log.error(String.format("[前端]用户修改登录密码失败，参数:%s, 错误信息:%s", jsonParam.toJSONString(), e.getMessage()));
//            return ResponseWrapper.failed(e.getCode(), e.getMessage());
//        }catch (Exception e){
//            log.error(String.format("[前端]用户修改登录密码失败"), e);
//            return ResponseWrapper.failed(ErrorCodeEnum.FL500);
//        }
//    }
//
//    //测试ok
//    @RequestMapping(value = "/forgotPassword2", method = RequestMethod.POST)
//    @ApiOperation(tags = "用户", httpMethod = "POST", value = "[前端]未登录时: 用户修改登录密码", response = String.class)
//    public ResponseWrapper forgotPassword2(
//            @ApiJsonObject(name = "forgotPassword2Params", value = {
//                    @ApiJsonProperty(key = "account", value = "用户名"),
//                    @ApiJsonProperty(key = "password", value = "密码"),
//                    @ApiJsonProperty(key = "repassword", value = "密码"),
//                    @ApiJsonProperty(key = "code", value = "验证码")
//            })@RequestBody JSONObject jsonParam) {
//        try {
//            String account = jsonParam.getString("account");
//            String password = jsonParam.getString("password");
//            String repassword = jsonParam.getString("repassword");
//            String vcode = jsonParam.getString("code");
//            Asserts.checkVcode(vcode,"验证码");
//
//            Asserts.checkAccount(account,"用户名");
//            Asserts.checkPsw(password,"密码");
//            Asserts.checkPsw(repassword,"密码");
//
//            userService.updatePassWord2(account, password,vcode);
//            return ResponseWrapper.succeed("修改成功");
//        }catch (ApiException e){
//            log.error(String.format("[前端]用户修改登录密码失败，参数:%s, 错误信息:%s", jsonParam.toJSONString(), e.getMessage()));
//            return ResponseWrapper.failed(e.getCode(), e.getMessage());
//        }catch (Exception e){
//            log.error(String.format("[前端]用户修改登录密码失败"), e);
//            return ResponseWrapper.failed(ErrorCodeEnum.FL500);
//        }
//    }
//
//
//    //测试ok
//    @RequestMapping(value = "/updatePasswordInLogin", method = RequestMethod.POST)
//    @ApiOperation(tags = "用户", httpMethod = "POST", value = "[前端]登录时: 用户修改登录密码", response = String.class)
//    public ResponseWrapper updatePasswordInLogin(
//            @ApiJsonObject(name = "updatePasswordInLoginParams", value = {
//                    @ApiJsonProperty(key = "oldPassword", value = "原密码"),
//                    @ApiJsonProperty(key = "password", value = "新密码"),
//                    @ApiJsonProperty(key = "repassword", value = "新密码")
//            })@RequestBody JSONObject jsonParam) {
//        try {
//            String account = jsonParam.getString("account");
//            String oldPassword = jsonParam.getString("oldPassword");
//            String password = jsonParam.getString("password");
//            String repassword = jsonParam.getString("repassword");
//            Asserts.checkPsw(oldPassword,"原密码");
//            Asserts.checkAccount(account,"用户名");
//            Asserts.checkPsw(password,"密码");
//            Asserts.checkPsw(repassword,"密码");
//
//            userService.updatePasswordInLogin(account, oldPassword, password, repassword);
//            return ResponseWrapper.succeed("修改成功");
//        }catch (ApiException e){
//            log.error(String.format("[前端]登录时: 用户修改登录密码失败，参数:%s, 错误信息:%s", jsonParam.toJSONString(), e.getMessage()));
//            return ResponseWrapper.failed(e.getCode(), e.getMessage());
//        }catch (Exception e){
//            log.error(String.format("[前端]登录时: 用户修改登录密码失败"), e);
//            return ResponseWrapper.failed(ErrorCodeEnum.FL500);
//        }
//    }
//
////    //测试ok
////    @RequestMapping(value = "/updatePayPasswordInLogin", method = RequestMethod.POST)
////    @ApiOperation(tags = "用户", httpMethod = "POST", value = "[前端]未忘记支付密码时: 用户修改支付密码", response = String.class)
////    public ResponseWrapper updatePayPasswordInLogin(
////            @ApiJsonObject(name = "updatePayPasswordInLoginParams", value = {
////                    @ApiJsonProperty(key = "account", value = "用户名"),
////                    @ApiJsonProperty(key = "password", value = "密码"),
////                    @ApiJsonProperty(key = "repassword", value = "密码")
////            })@RequestBody JSONObject jsonParam) {
////        try {
////            String account = jsonParam.getString("account");
////            String password = jsonParam.getString("password");
////            String repassword = jsonParam.getString("repassword");
////
////            Asserts.checkAccount(account,"用户名");
////            Asserts.checkPsw(password,"密码");
////            Asserts.checkPsw(repassword,"密码");
////
////            userService.updatePayPassword(account, password,repassword);
////            return ResponseWrapper.succeed();
////        }catch (ApiException e){
////            log.error(String.format("[前端]未登录时: 用户修改支付密码失败，参数:%s, 错误信息:%s", jsonParam.toJSONString(), e.getMessage()));
////            return ResponseWrapper.failed(e.getCode(), e.getMessage());
////        }catch (Exception e){
////            log.error(String.format("[前端]未登录时: 用户修改支付密码失败"), e);
////            return ResponseWrapper.failed(ErrorCodeEnum.FL500);
////        }
////    }
////    //测试ok
//    @RequestMapping(value = "/updatePayPasswordInLogin", method = RequestMethod.POST)
//    @ApiOperation(tags = "用户", httpMethod = "POST", value = "[前端]未忘记支付密码时：用户修改支付密码", response = String.class)
//    public ResponseWrapper updatePayPasswordInLogin(
//            @ApiJsonObject(name = "updatePayPasswordInLoginParams", value = {
//                    @ApiJsonProperty(key = "oldPassword", value = "原密码"),
//                    @ApiJsonProperty(key = "password", value = "新密码"),
//                    @ApiJsonProperty(key = "repassword", value = "新密码")
//            })@RequestBody JSONObject jsonParam) {
//        try {
//
//            String account = jsonParam.getString("account");
//            String oldPassword = jsonParam.getString("oldPassword");
//            String password = jsonParam.getString("password");
//            String repassword = jsonParam.getString("repassword");
//            Asserts.checkPsw(oldPassword,"原密码");
//            Asserts.checkAccount(account,"用户名");
//            Asserts.checkPsw(password,"密码");
//            Asserts.checkPsw(repassword,"密码");
//
//            userService.updatePayPassword(account, oldPassword, password, repassword);
//            return ResponseWrapper.succeed("修改成功");
//
//        }catch (ApiException e){
//            log.error(String.format("[前端]登录时：用户修改支付密码失败，参数:%s, 错误信息:%s", jsonParam.toJSONString(), e.getMessage()));
//            return ResponseWrapper.failed(e.getCode(), e.getMessage());
//        }catch (Exception e){
//            log.error(String.format("[前端]登录时：用户修改支付密码失败"), e);
//            return ResponseWrapper.failed(ErrorCodeEnum.FL500);
//        }
//    }
//
//    //测试ok
//    @RequestMapping(value = "/forgotPayPassword", method = RequestMethod.POST)
//    @ApiOperation(tags = "用户", httpMethod = "POST", value = "[前端]忘记支付密码时：用户修改支付密码", response = String.class)
//    public ResponseWrapper forgotPayPassword(
//            @ApiJsonObject(name = "forgotPayPasswordParams", value = {
//                    @ApiJsonProperty(key = "password", value = "新密码"),
//                    @ApiJsonProperty(key = "repassword", value = "新密码")
//            })@RequestBody JSONObject jsonParam) {
//        try {
//            String account = jsonParam.getString("account");
//            String password = jsonParam.getString("password");
//            String repassword = jsonParam.getString("repassword");
//            Asserts.checkAccount(account,"用户名");
//            Asserts.checkPsw(password,"密码");
//            Asserts.checkPsw(repassword,"密码");
//
//            userService.updatePayPassword(account, password, repassword);
//            return ResponseWrapper.succeed("修改成功");
//        }catch (ApiException e){
//            log.error(String.format("[前端]登录时：用户修改支付密码失败，参数:%s, 错误信息:%s", jsonParam.toJSONString(), e.getMessage()));
//            return ResponseWrapper.failed(e.getCode(), e.getMessage());
//        }catch (Exception e){
//            log.error(String.format("[前端]登录时：用户修改支付密码失败"), e);
//            return ResponseWrapper.failed(ErrorCodeEnum.FL500);
//        }
//    }
//
//    //测试ok
//    @CurrentManager
//    @RequestMapping(value = "/updateMobile", method = RequestMethod.POST)
//    @ApiOperation(tags = "用户", httpMethod = "POST", value = "[前端]用户修改手机号", response = String.class)
//    public ResponseWrapper updateMobile(
//            @ApiJsonObject(name = "updateMobileParams", value = {
//                    @ApiJsonProperty(key = "mobile", value = "手机号"),
//                    @ApiJsonProperty(key = "code", value = "验证码")
//            })@RequestBody JSONObject jsonParam) {
//        try {
//            String mobile = jsonParam.getString("mobile");
//            String code = jsonParam.getString("code");
//            String account = jsonParam.getString("account");
//            Asserts.checkAccount(account,"用户名");
//            Asserts.checkMobile(mobile,"手机号");
//            Asserts.checkVcode(code,"验证码");
//
//            userService.updateMobile(account, mobile, code);
//            return ResponseWrapper.succeed("修改成功");
//        }catch (ApiException e){
//            log.error(String.format("[前端]用户修改手机号失败，参数:%s, 错误信息:%s", jsonParam.toJSONString(), e.getMessage()));
//            return ResponseWrapper.failed(e.getCode(), e.getMessage());
//        }catch (Exception e){
//            log.error(String.format("[前端]用户修改手机号失败"), e);
//            return ResponseWrapper.failed(ErrorCodeEnum.FL500);
//        }
//    }
//    //测试ok
//    @RequestMapping(value = "/userAuth", method = RequestMethod.POST)
//    @ApiOperation(tags = "用户", httpMethod = "POST", value = "[前端]实名认证", response = String.class)
//    public ResponseWrapper userAuth(
//            @ApiJsonObject(name = "userAuthParams", value = {
//                    @ApiJsonProperty(key = "account", value = "用户名"),
//                    @ApiJsonProperty(key = "realName", value = "真实姓名"),
//                    @ApiJsonProperty(key = "idCard", value = "身份证"),
//                    @ApiJsonProperty(key = "bankCard", value = "银行卡号"),
//                    @ApiJsonProperty(key = "bankMobile", value = "银行绑定手机号")
//            })@RequestBody JSONObject jsonParam) {
//        try {
//            String realName = jsonParam.getString("realName");
//            String idCard = jsonParam.getString("idCard");
//            String bankCard = jsonParam.getString("bankCard");
//            String bankMobile = jsonParam.getString("bankMobile");
//            String account = jsonParam.getString("account");
//
//            Asserts.checkIdCard(idCard,"身份证");
//            Asserts.checkMobile(bankMobile,"银行绑定手机号");
//            Asserts.notBlank(realName, "真实姓名");
//            Asserts.notBlank(bankCard, "银行卡号");
//            Asserts.notBlank(account, "用户名");
//
//            userService.userAuth(account, realName, idCard, bankCard, bankMobile);
//            return ResponseWrapper.succeed();
//        }catch (ApiException e){
//            log.error(String.format("[前端]实名认证失败，参数:%s, 错误信息:%s", jsonParam.toJSONString(), e.getMessage()));
//            return ResponseWrapper.failed(e.getCode(), e.getMessage());
//        }catch (Exception e){
//            log.error(String.format("[前端]实名认证失败"), e);
//            return ResponseWrapper.failed(ErrorCodeEnum.FL500);
//        }
//
//    }
//
//    //测试ok
//    @CurrentManager
//    @RequestMapping(value = "/getUser", method = RequestMethod.POST)
//    @ApiOperation(tags = "用户", httpMethod = "POST", value = "[前端]获取用户信息", response = UserVo.class)
//    public ResponseWrapper getUser(
//            @ApiJsonObject(name = "getUserParams", value = {}) @RequestBody JSONObject jsonParam) {
//
//        try {
//            String account = jsonParam.getString("account");
//            Asserts.notBlank(account, "用户名");
//            UserVo vo = userService.getUser(account);
//            return ResponseWrapper.succeed(vo);
//        }catch (ApiException e){
//            log.error(String.format("[前端]获取用户信息失败，参数:%s, 错误信息:%s", jsonParam.toJSONString(), e.getMessage()));
//            return ResponseWrapper.failed(e.getCode(), e.getMessage());
//        }catch (Exception e){
//            log.error(String.format("[前端]获取用户信息失败"), e);
//            return ResponseWrapper.failed(ErrorCodeEnum.FL500);
//        }
//    }
//
//    //测试ok
//    @CurrentManager
//    @RequestMapping(value = "/getAddress", method = RequestMethod.POST)
//    @ApiOperation(tags = "用户", httpMethod = "POST", value = "[前端]获取用户收货地址", response = ReceivAddressVo.class)
//    public ResponseWrapper getAddress(
//            @ApiJsonObject(name = "getAddressParams", value = {}) @RequestBody JSONObject jsonParam) {
//
//        try {
//            String account = jsonParam.getString("account");
//            Asserts.notBlank(account, "用户名");
//            ReceivAddressVo receivAddressVo = userService.getAddress(account);
//            return ResponseWrapper.succeed(receivAddressVo);
//        }catch (ApiException e){
//            log.error(String.format("[前端]获取用户收货地址，参数:%s, 错误信息:%s", jsonParam.toJSONString(), e.getMessage()));
//            return ResponseWrapper.failed(e.getCode(), e.getMessage());
//        }catch (Exception e){
//            log.error(String.format("[前端]获取用户收货地址"), e);
//            return ResponseWrapper.failed(ErrorCodeEnum.FL500);
//        }
//    }
//
//    //测试ok
//    @CurrentManager
//    @RequestMapping(value = "/aboutUs", method = RequestMethod.POST)
//    @ApiOperation(tags = "用户", httpMethod = "POST", value = "[前端]关于我们", response = SpecialVo.class)
//    public ResponseWrapper aboutUs(
//            @ApiJsonObject(name = "aboutUsParams", value = {}) @RequestBody JSONObject jsonParam) {
//
//        try {
//            String account = jsonParam.getString("account");
//            Asserts.notBlank(account, "用户名");
//            SpecialVo vo = userService.aboutUs();
//            return ResponseWrapper.succeed(vo);
//        }catch (ApiException e){
//            log.error(String.format("[前端]关于我们 失败，参数:%s, 错误信息:%s", jsonParam.toJSONString(), e.getMessage()));
//            return ResponseWrapper.failed(e.getCode(), e.getMessage());
//        }catch (Exception e){
//            log.error(String.format("[前端]关于我们 失败"), e);
//            return ResponseWrapper.failed(ErrorCodeEnum.FL500);
//        }
//    }
//
//
//    //测试ok
//    @CurrentManager
//    @RequestMapping(value = "/getProfit", method = RequestMethod.POST)
//    @ApiOperation(tags = "用户", httpMethod = "POST", value = "[前端]获取用户收益情况", response = UserProfitVo.class)
//    public ResponseWrapper getProfit(
//            @ApiJsonObject(name = "getProfitParams", value = {}) @RequestBody JSONObject jsonParam) {
//
//        try {
//            String account = jsonParam.getString("account");
//            Asserts.notBlank(account, "用户名");
//
//            UserProfitVo vo = userService.getProfit(account);
//            return ResponseWrapper.succeed(vo);
//
//        }catch (ApiException e){
//            log.error(String.format("[前端]获取用户收益情况 失败，参数:%s, 错误信息:%s", jsonParam.toJSONString(), e.getMessage()));
//            return ResponseWrapper.failed(e.getCode(), e.getMessage());
//        }catch (Exception e){
//            log.error(String.format("[前端]获取用户收益情况 失败"), e);
//            return ResponseWrapper.failed(ErrorCodeEnum.FL500);
//        }
//    }
//
//    @CurrentManager
//    @RequestMapping(value = "/getRecommedAndTeam", method = RequestMethod.POST)
//    @ApiOperation(tags = "用户", httpMethod = "POST", value = "[前端]获取用户直推人数和团队人数", response = RTVo.class)
//    public ResponseWrapper getRecommedAndTeam(
//            @ApiJsonObject(name = "getRecommedAndTeamParams", value = {}) @RequestBody JSONObject jsonParam) {
//
//        try {
//            String account = jsonParam.getString("account");
//            Asserts.notBlank(account, "用户名");
//
//            RTVo vo = userService.getRecommedAndTeam(account);
//            return ResponseWrapper.succeed(vo);
//
//        }catch (ApiException e){
//            log.error(String.format("[前端]获取用户直推人数和团队人数失败，参数:%s, 错误信息:%s", jsonParam.toJSONString(), e.getMessage()));
//            return ResponseWrapper.failed(e.getCode(), e.getMessage());
//        }catch (Exception e){
//            log.error(String.format("[前端]获取用户直推人数和团队人数失败"), e);
//            return ResponseWrapper.failed(ErrorCodeEnum.FL500);
//        }
//    }
//
//    //初始化平台用户，不可二次使用
////    @RequestMapping(value = "/initUser", method = RequestMethod.POST)
////    @ApiOperation(tags = "用户", httpMethod = "POST", value = "[特殊使用]初始化平台用户，不可二次使用", response = String.class)
////    public ResponseWrapper initUser(
////            @ApiJsonObject(name = "initUserParams", value = {}) @RequestBody JSONObject jsonParam) {
////
////        try {
////            userService.registry_initUser1();
////            return ResponseWrapper.succeed();
////        }catch (ApiException e){
////            log.error(String.format("[特殊使用]初始化平台用户，不可二次使用失败，参数:%s, 错误信息:%s", jsonParam.toJSONString(), e.getMessage()));
////            return ResponseWrapper.failed(e.getCode(), e.getMessage());
////        }catch (Exception e){
////            log.error(String.format("[特殊使用]初始化平台用户，不可二次使用失败"), e);
////            return ResponseWrapper.failed(ErrorCodeEnum.FL500);
////        }
////    }
//
//}
